{extend name="public/base" /}
{block name="body"}
<div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-body">
                    <form action="{:url('')}" method="post"  class="layui-form">
                        {volist name="lists" id="config"}
                        <div class="layui-form-item">
                            <div class="zz-form-title">
                                {$config.title}
                                <span class="check-tips">（&nbsp;{$key}&nbsp;）</span>
                                {if isset($config['remark'])}
                                <p><span class="check-tips"><i class="layui-icon layui-icon-about"></i> <span class="layui-inline">{$config.remark}</span></span></p>
                                {/if}
                            </div>
                            {switch $config.type}
                            {case text}
                            <input type="text" class="layui-input" name="{$key}" value="{$config.value}">
                            {/case}
                            {case radio}
                            {foreach $config['option'] as $ok=>$item }
                            <input type="radio" name="{$key}" value="{$ok}" title="{$item}" {$config['value']==$ok?'checked':''}>
                            {/foreach}
                            {/case}
                            {case checkbox}

                            {foreach $config['option'] as $ok=>$item }
                            <input type="checkbox" name="{$key}[]" value="{$ok}" title="{$item}" {:in_array($ok,explode(',',$config['value']))?'checked':''}>
                            {/foreach}
                            {/case}
                            {case textarea}
                            <textarea class="layui-textarea" name="{$key}">{$config.value}</textarea>
                            {/case}
                            {case select}
                            <select name="{$key}">
                                {foreach $config['option'] as $ok=>$item }
                                <option value="{$ok}" {eq name="config.value" value="$ok"}selected{/eq}>{$item}</option>
                                {/foreach}
                            </select>
                            {/case}
                            {case image}
                            <div class="zz-upload-pic">
                                <div class="zz-upload" name="{$key}" value="{$config.value}"></div>
                            </div>
                            {/case}
                            {case images}
                            <div class="zz-upload-pic">
                                <div class="zz-upload" name="{$key}" multiple="multiple" value="{$config.value}"></div>
                            </div>
                            {/case}
                            {/switch}
                        </div>
                        {/volist}
                        <div class="layui-form-item layui-layout-admin">
                            <input type="hidden" name="name" value="{$name}">
                            <button type="submit" class="layui-btn" lay-submit="" lay-filter="zz-btn-submit">立即提交</button>
                            <button type="button" class="layui-btn layui-btn-primary zz-btn-cancel">取消</button>
                        </div>
                    </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script src="__JS__/upload.js"></script>
{/block}